//一、四舍五入
let num1=13.454;
let num2=13.545;
console.log(Math.round(num1));//13
console.log(Math.round(num2));//14
console.log(num1.toFixed(0));//返回字符串13
console.log(num2.toFixed(0));//返回字符串14

//注意：toFixed()返回字符串

//二、向上取整
let num1=13.454;
let num2=13.545;
console.log(Math.ceil(num1));//14
console.log(Math.ceil(num2));//14

//三、向下取整
let num1=13.454;
let num2=13.545;
console.log(parseInt(num1));//13
console.log(parseInt(num2));//13
console.log(Math.floor(num1));//13
console.log(Math.floor(num2));//13

//舍弃小数取整
console.log(Math.trunc(1.5555)) // => 1
console.log(Math.trunc(1.4999)) // => 1 

